package studentsystem1;

//import javax.swing.*;
//import java.awt.*;
//
//class MyPanel extends JPanel {
//    Image img=Toolkit.getDefaultToolkit().getImage("c:/smile.jpg");
//    public void paint(Graphics g){
//        g.drawImage(img,10,10,this);
//    }
//}
import javax.swing.*;
import java.awt.*;

class MyPanel extends JPanel {
    Image img = Toolkit.getDefaultToolkit().getImage("d:/system.png");

    @Override
    public void paint(Graphics g) {
        super.paint(g);
        if (img!= null) {
            int x = (getWidth() - img.getWidth(this)) / 2;
            int y = (getHeight() - img.getHeight(this)) / 2;
            g.drawImage(img, x, y, this);
        }
    }
}

